﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using Sicurezza.CA.Manager;

namespace Sicurezza.CA.Server
{
    public partial class Login : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void LoginButton_Click(object sender, EventArgs e)
        {
            if (AuthenticationManager.ValidateUser(Login1.UserName, Login1.Password))
            {
                
                //Response.Redirect("~/Default.aspx");
            }
        }

        protected void Login1_Authenticate(object sender, AuthenticateEventArgs e)
        {
            if (AuthenticationManager.ValidateUser(Login1.UserName, Login1.Password))
            {
                e.Authenticated = true;

                FormsAuthentication.RedirectFromLoginPage(Login1.UserName, Login1.RememberMeSet);
                Response.Redirect("~/Default.aspx");
            }
        }

        protected void Login1_Authenticate1(object sender, AuthenticateEventArgs e)
        {
            if (AuthenticationManager.ValidateUser(Login1.UserName, Login1.Password))
            {
                e.Authenticated = true;

                //FormsAuthentication.RedirectFromLoginPage(Login1.UserName, Login1.RememberMeSet);
                //Response.Redirect("~/Default.aspx");
            }
        }
    }
}
